// router.js
import { createRouter, createWebHistory } from 'vue-router'
const routes = [
  {
    path: '/MyNav',
    name: 'MyNav',
    component: () => import('../views/IndexEcharts/index.vue'),
    children: [
      {
        path: '/environment',
        name: 'environment',
        component: () => import('../views/IndexEcharts/environment.vue')
      },
      {
        path: '/energyConsumption',
        name: 'energyConsumption',
        component: () => import('../views/IndexEcharts/energyConsumption.vue')
      }
    ]
  },
  {
    path: '/TimeTask',
    name: 'TimeTask',
    component: () => import('../views/TimeTask/index.vue')
  },
  {
    path: '/Product',
    name: 'Product',
    component: () => import('../views/Product/index.vue')
  },
  {
    path: '/Device',
    name: 'Device',
    component: () => import('../views/Device/index.vue')
  },
  {
    path: '/AutoTemplate',
    name: 'AutoTemplate',
    component: () => import('../views/AutoTemplate/index.vue')
  },
  {
    path: '/VirtualDevice',
    name: 'VirtualDevice',
    component: () => import('../views/VirtualDevice/index.vue')
  },
  {
    path: '/SystemSettings',
    name: 'SystemSettings',
    component: () => import('../views/SystemSettings/index.vue')
  },
  {
    path: '/SystemVariable',
    name: 'SystemVariable',
    component: () => import('../views/SystemVariable/index.vue')
  },
  {
    path: '/AboutProject',
    name: 'AboutProject',
    component: () => import('../views/AboutProject/index.vue')
  },
  {
    path: '/CustomDevice',
    name: 'CustomDevice',
    component: () => import('../views/CustomDevice/index.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
